#!/usr/bin/python3
# -*- coding: utf-8 -*-

"""
# @version: v1.0
# @author : wlisingle
# @Email : 19688513@qq.com
# @Project : g-carbon-bio
# @File : stock_historical_data_with_ma.py
# @Software: PyCharm
# @time: 2025/3/11 19:26
# @description : 
"""
from service.models.stock_historical_data import StockHistoricalData


class StockHistoricalDataWithMA(StockHistoricalData):
    def __init__(self, date: str, stock_code: str, open_price: float, close_price: float,
                 high_price: float, low_price: float, volume: int, turnover: float,
                 amplitude: float, change_rate: float, change_amount: float,
                 turnover_rate: float,
                 ma5: float = None, ma10: float = None, ma20: float = None,
                 ma30: float = None, ma60: float = None, ma120: float = None) -> None:
        """
        初始化带有移动平均线的历史行情数据

        :param date: 日期
        :param stock_code: 股票代码
        :param open_price: 开盘价
        :param close_price: 收盘价
        :param high_price: 最高价
        :param low_price: 最低价
        :param volume: 成交量（单位：手）
        :param turnover: 成交额（单位：元）
        :param amplitude: 振幅（单位：%）
        :param change_rate: 涨跌幅（单位：%）
        :param change_amount: 涨跌额（单位：元）
        :param turnover_rate: 换手率（单位：%）
        :param ma5: 5日移动平均
        :param ma10: 10日移动平均
        :param ma20: 20日移动平均
        :param ma30: 30日移动平均
        :param ma60: 60日移动平均
        :param ma120: 120日移动平均
        """
        super().__init__(date, stock_code, open_price, close_price, high_price, low_price,
                         volume, turnover, amplitude, change_rate, change_amount, turnover_rate)
        self.ma5 = ma5
        self.ma10 = ma10
        self.ma20 = ma20
        self.ma30 = ma30
        self.ma60 = ma60
        self.ma120 = ma120

    def __repr__(self):
        return (f"StockHistoricalDataWithMA(date={self.date}, stock_code={self.stock_code}, "
                f"open_price={self.open_price}, close_price={self.close_price}, "
                f"high_price={self.high_price}, low_price={self.low_price}, "
                f"volume={self.volume}, turnover={self.turnover}, amplitude={self.amplitude}, "
                f"change_rate={self.change_rate}, change_amount={self.change_amount}, "
                f"turnover_rate={self.turnover_rate}, ma5={self.ma5}, ma10={self.ma10}, "
                f"ma20={self.ma20}, ma30={self.ma30}, ma60={self.ma60}, ma120={self.ma120})")
